import os

def list_file(top,filter=".tif"):
	"""
    Args:

    Returns:

    Raises:
        RuntimeError: 
    """
	file_list = []
	for root,dirs,files in os.walk(top):
		for file in files:
			if file.endswith(filter):
				file_list.append(os.path.join(root,file))

	return file_list


def is_exists(file):
    if not os.path.exists(file):
        try:
            os.makedirs(file)
        except Exception as e:
            raise IOError(e)
